package com.cy.pj.common.util;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class ServletUtil {

       public static HttpServletRequest getRequest(){
           return getRequestAttributes().getRequest();
       }
       public static ServletRequestAttributes getRequestAttributes(){
           return (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
       }
}
